const TOKEN = 'token'
const USER = 'userInfo'


function setToken(token){
    sessionStorage.setItem(TOKEN,token)
}

function getToken(){
    return sessionStorage.getItem(TOKEN)
}

function setUserInfo(userInfo){
    sessionStorage.setItem(USER,JSON.stringify(userInfo))
}

function getUserInfo(){
    return JSON.parse(sessionStorage.getItem(USER))
}

function removeTandU(){
    sessionStorage.removeItem(TOKEN)
    sessionStorage.removeItem(USER)
}



export default {
    setToken,
    getToken,
    setUserInfo,
    getUserInfo,
    removeTandU
}